\(\int \frac {\cot ^2(c+d x)}{(a+b \sec (c+d x))^{3/2}} \, dx\) [343]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [F(-1)]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 23, antiderivative size = 449 \[ \int \frac {\cot ^2(c+d x)}{(a+b \sec (c+d x))^{3/2}} \, dx=\frac {2 \sqrt {a+b} \cot (c+d x) \operatorname {EllipticPi}\left (\frac {a+b}{a},\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a^2 d}+\frac {2 \left (a^2+b^2\right ) \cot (c+d x) E\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {-\frac {b (-1+\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a (a-b) (a+b)^{3/2} d}-\frac {\left (a^2-a b+2 b^2\right ) \cot (c+d x) \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {-\frac {b (-1+\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a (a-b) (a+b)^{3/2} d}-\frac {\cot (c+d x)}{d (a+b \sec (c+d x))^{3/2}}+\frac {b^2 \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))^{3/2}}+\frac {2 b^2 \left (a^2+b^2\right ) \tan (c+d x)}{a \left (a^2-b^2\right )^2 d \sqrt {a+b \sec (c+d x)}} \]

[Out]

-cot(d*x+c)/d/(a+b*sec(d*x+c))^(3/2)+2*cot(d*x+c)*EllipticPi((a+b*sec(d*x+c))^(1/2)/(a+b)^(1/2),(a+b)/a,((a+b)
/(a-b))^(1/2))*(a+b)^(1/2)*(b*(1-sec(d*x+c))/(a+b))^(1/2)*(-b*(1+sec(d*x+c))/(a-b))^(1/2)/a^2/d+2*(a^2+b^2)*co
t(d*x+c)*EllipticE((a+b*sec(d*x+c))^(1/2)/(a+b)^(1/2),((a+b)/(a-b))^(1/2))*(-b*(-1+sec(d*x+c))/(a+b))^(1/2)*(-
b*(1+sec(d*x+c))/(a-b))^(1/2)/a/(a-b)/(a+b)^(3/2)/d-(a^2-a*b+2*b^2)*cot(d*x+c)*EllipticF((a+b*sec(d*x+c))^(1/2
)/(a+b)^(1/2),((a+b)/(a-b))^(1/2))*(-b*(-1+sec(d*x+c))/(a+b))^(1/2)*(-b*(1+sec(d*x+c))/(a-b))^(1/2)/a/(a-b)/(a
+b)^(3/2)/d+b^2*tan(d*x+c)/(a^2-b^2)/d/(a+b*sec(d*x+c))^(3/2)+2*b^2*(a^2+b^2)*tan(d*x+c)/a/(a^2-b^2)^2/d/(a+b*
sec(d*x+c))^(1/2)

Rubi [A] (verified)

Time = 1.21 (sec) , antiderivative size = 664, normalized size of antiderivative = 1.48, number of steps used = 14, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.478, Rules used = {3981, 3870, 4143, 4006, 3869, 3917, 4089, 3960, 3918, 4088, 4090} \[ \int \frac {\cot ^2(c+d x)}{(a+b \sec (c+d x))^{3/2}} \, dx=\frac {2 \sqrt {a+b} \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} \operatorname {EllipticPi}\left (\frac {a+b}{a},\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right )}{a^2 d}-\frac {2 b^2 \tan (c+d x)}{a d \left (a^2-b^2\right ) \sqrt {a+b \sec (c+d x)}}+\frac {4 a b^2 \tan (c+d x)}{d \left (a^2-b^2\right )^2 \sqrt {a+b \sec (c+d x)}}+\frac {b^2 \tan (c+d x)}{d \left (a^2-b^2\right ) (a+b \sec (c+d x))^{3/2}}+\frac {2 \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right )}{a d \sqrt {a+b}}-\frac {(3 a-b) \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right )}{d (a-b) (a+b)^{3/2}}-\frac {2 \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} E\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{a d \sqrt {a+b}}+\frac {4 a \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} E\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{d (a-b) (a+b)^{3/2}}-\frac {\cot (c+d x)}{d (a+b \sec (c+d x))^{3/2}} \]

[In]

Int[Cot[c + d*x]^2/(a + b*Sec[c + d*x])^(3/2),x]

[Out]

(4*a*Cot[c + d*x]*EllipticE[ArcSin[Sqrt[a + b*Sec[c + d*x]]/Sqrt[a + b]], (a + b)/(a - b)]*Sqrt[(b*(1 - Sec[c
+ d*x]))/(a + b)]*Sqrt[-((b*(1 + Sec[c + d*x]))/(a - b))])/((a - b)*(a + b)^(3/2)*d) - (2*Cot[c + d*x]*Ellipti
cE[ArcSin[Sqrt[a + b*Sec[c + d*x]]/Sqrt[a + b]], (a + b)/(a - b)]*Sqrt[(b*(1 - Sec[c + d*x]))/(a + b)]*Sqrt[-(
(b*(1 + Sec[c + d*x]))/(a - b))])/(a*Sqrt[a + b]*d) - ((3*a - b)*Cot[c + d*x]*EllipticF[ArcSin[Sqrt[a + b*Sec[
c + d*x]]/Sqrt[a + b]], (a + b)/(a - b)]*Sqrt[(b*(1 - Sec[c + d*x]))/(a + b)]*Sqrt[-((b*(1 + Sec[c + d*x]))/(a
 - b))])/((a - b)*(a + b)^(3/2)*d) + (2*Cot[c + d*x]*EllipticF[ArcSin[Sqrt[a + b*Sec[c + d*x]]/Sqrt[a + b]], (
a + b)/(a - b)]*Sqrt[(b*(1 - Sec[c + d*x]))/(a + b)]*Sqrt[-((b*(1 + Sec[c + d*x]))/(a - b))])/(a*Sqrt[a + b]*d
) + (2*Sqrt[a + b]*Cot[c + d*x]*EllipticPi[(a + b)/a, ArcSin[Sqrt[a + b*Sec[c + d*x]]/Sqrt[a + b]], (a + b)/(a
 - b)]*Sqrt[(b*(1 - Sec[c + d*x]))/(a + b)]*Sqrt[-((b*(1 + Sec[c + d*x]))/(a - b))])/(a^2*d) - Cot[c + d*x]/(d
*(a + b*Sec[c + d*x])^(3/2)) + (b^2*Tan[c + d*x])/((a^2 - b^2)*d*(a + b*Sec[c + d*x])^(3/2)) + (4*a*b^2*Tan[c
+ d*x])/((a^2 - b^2)^2*d*Sqrt[a + b*Sec[c + d*x]]) - (2*b^2*Tan[c + d*x])/(a*(a^2 - b^2)*d*Sqrt[a + b*Sec[c +
d*x]])

Rule 3869

Int[1/Sqrt[csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Simp[2*(Rt[a + b, 2]/(a*d*Cot[c + d*x]))*Sqrt[b
*((1 - Csc[c + d*x])/(a + b))]*Sqrt[(-b)*((1 + Csc[c + d*x])/(a - b))]*EllipticPi[(a + b)/a, ArcSin[Sqrt[a + b
*Csc[c + d*x]]/Rt[a + b, 2]], (a + b)/(a - b)], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0]

Rule 3870

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Simp[b^2*Cot[c + d*x]*((a + b*Csc[c + d*x])^(n +
 1)/(a*d*(n + 1)*(a^2 - b^2))), x] + Dist[1/(a*(n + 1)*(a^2 - b^2)), Int[(a + b*Csc[c + d*x])^(n + 1)*Simp[(a^
2 - b^2)*(n + 1) - a*b*(n + 1)*Csc[c + d*x] + b^2*(n + 2)*Csc[c + d*x]^2, x], x], x] /; FreeQ[{a, b, c, d}, x]
 && NeQ[a^2 - b^2, 0] && LtQ[n, -1] && IntegerQ[2*n]

Rule 3917

Int[csc[(e_.) + (f_.)*(x_)]/Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Simp[-2*(Rt[a + b, 2]/(b*
f*Cot[e + f*x]))*Sqrt[(b*(1 - Csc[e + f*x]))/(a + b)]*Sqrt[(-b)*((1 + Csc[e + f*x])/(a - b))]*EllipticF[ArcSin
[Sqrt[a + b*Csc[e + f*x]]/Rt[a + b, 2]], (a + b)/(a - b)], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]

Rule 3918

Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_Symbol] :> Simp[(-b)*Cot[e + f*x]*(
(a + b*Csc[e + f*x])^(m + 1)/(f*(m + 1)*(a^2 - b^2))), x] + Dist[1/((m + 1)*(a^2 - b^2)), Int[Csc[e + f*x]*(a
+ b*Csc[e + f*x])^(m + 1)*(a*(m + 1) - b*(m + 2)*Csc[e + f*x]), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 -
b^2, 0] && LtQ[m, -1] && IntegerQ[2*m]

Rule 3960

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)/cos[(e_.) + (f_.)*(x_)]^2, x_Symbol] :> Simp[Tan[e + f*x]*((a
+ b*Csc[e + f*x])^m/f), x] + Dist[b*m, Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^(m - 1), x], x] /; FreeQ[{a, b, e
, f, m}, x]

Rule 3981

Int[cot[(c_.) + (d_.)*(x_)]^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Int[ExpandIntegrand
[(a + b*Csc[c + d*x])^n, (-1 + Sec[c + d*x]^2)^(-m/2), x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[a^2 - b^2, 0
] && ILtQ[m/2, 0] && IntegerQ[n - 1/2] && EqQ[m, -2]

Rule 4006

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))/Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Dist[c, In
t[1/Sqrt[a + b*Csc[e + f*x]], x], x] + Dist[d, Int[Csc[e + f*x]/Sqrt[a + b*Csc[e + f*x]], x], x] /; FreeQ[{a,
b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0]

Rule 4088

Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_))
, x_Symbol] :> Simp[(-(A*b - a*B))*Cot[e + f*x]*((a + b*Csc[e + f*x])^(m + 1)/(f*(m + 1)*(a^2 - b^2))), x] + D
ist[1/((m + 1)*(a^2 - b^2)), Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^(m + 1)*Simp[(a*A - b*B)*(m + 1) - (A*b - a
*B)*(m + 2)*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, A, B, e, f}, x] && NeQ[A*b - a*B, 0] && NeQ[a^2 - b^2, 0]
 && LtQ[m, -1]

Rule 4089

Int[(csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)))/Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)
], x_Symbol] :> Simp[-2*(A*b - a*B)*Rt[a + b*(B/A), 2]*Sqrt[b*((1 - Csc[e + f*x])/(a + b))]*(Sqrt[(-b)*((1 + C
sc[e + f*x])/(a - b))]/(b^2*f*Cot[e + f*x]))*EllipticE[ArcSin[Sqrt[a + b*Csc[e + f*x]]/Rt[a + b*(B/A), 2]], (a
*A + b*B)/(a*A - b*B)], x] /; FreeQ[{a, b, e, f, A, B}, x] && NeQ[a^2 - b^2, 0] && EqQ[A^2 - B^2, 0]

Rule 4090

Int[(csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)))/Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)
], x_Symbol] :> Dist[A - B, Int[Csc[e + f*x]/Sqrt[a + b*Csc[e + f*x]], x], x] + Dist[B, Int[Csc[e + f*x]*((1 +
 Csc[e + f*x])/Sqrt[a + b*Csc[e + f*x]]), x], x] /; FreeQ[{a, b, e, f, A, B}, x] && NeQ[a^2 - b^2, 0] && NeQ[A
^2 - B^2, 0]

Rule 4143

Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))/Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_
.) + (a_)], x_Symbol] :> Int[(A + (B - C)*Csc[e + f*x])/Sqrt[a + b*Csc[e + f*x]], x] + Dist[C, Int[Csc[e + f*x
]*((1 + Csc[e + f*x])/Sqrt[a + b*Csc[e + f*x]]), x], x] /; FreeQ[{a, b, e, f, A, B, C}, x] && NeQ[a^2 - b^2, 0
]

Rubi steps \begin{align*} \text {integral}& = \int \left (-\frac {1}{(a+b \sec (c+d x))^{3/2}}+\frac {\csc ^2(c+d x)}{(a+b \sec (c+d x))^{3/2}}\right ) \, dx \\ & = -\int \frac {1}{(a+b \sec (c+d x))^{3/2}} \, dx+\int \frac {\csc ^2(c+d x)}{(a+b \sec (c+d x))^{3/2}} \, dx \\ & = -\frac {\cot (c+d x)}{d (a+b \sec (c+d x))^{3/2}}-\frac {2 b^2 \tan (c+d x)}{a \left (a^2-b^2\right ) d \sqrt {a+b \sec (c+d x)}}-\frac {1}{2} (3 b) \int \frac {\sec (c+d x)}{(a+b \sec (c+d x))^{5/2}} \, dx+\frac {2 \int \frac {\frac {1}{2} \left (-a^2+b^2\right )+\frac {1}{2} a b \sec (c+d x)+\frac {1}{2} b^2 \sec ^2(c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx}{a \left (a^2-b^2\right )} \\ & = -\frac {\cot (c+d x)}{d (a+b \sec (c+d x))^{3/2}}+\frac {b^2 \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))^{3/2}}-\frac {2 b^2 \tan (c+d x)}{a \left (a^2-b^2\right ) d \sqrt {a+b \sec (c+d x)}}+\frac {2 \int \frac {\frac {1}{2} \left (-a^2+b^2\right )+\left (\frac {a b}{2}-\frac {b^2}{2}\right ) \sec (c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx}{a \left (a^2-b^2\right )}+\frac {b \int \frac {\sec (c+d x) \left (-\frac {3 a}{2}+\frac {1}{2} b \sec (c+d x)\right )}{(a+b \sec (c+d x))^{3/2}} \, dx}{a^2-b^2}+\frac {b^2 \int \frac {\sec (c+d x) (1+\sec (c+d x))}{\sqrt {a+b \sec (c+d x)}} \, dx}{a \left (a^2-b^2\right )} \\ & = -\frac {2 \cot (c+d x) E\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a \sqrt {a+b} d}-\frac {\cot (c+d x)}{d (a+b \sec (c+d x))^{3/2}}+\frac {b^2 \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))^{3/2}}+\frac {4 a b^2 \tan (c+d x)}{\left (a^2-b^2\right )^2 d \sqrt {a+b \sec (c+d x)}}-\frac {2 b^2 \tan (c+d x)}{a \left (a^2-b^2\right ) d \sqrt {a+b \sec (c+d x)}}-\frac {\int \frac {1}{\sqrt {a+b \sec (c+d x)}} \, dx}{a}+\frac {b \int \frac {\sec (c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx}{a (a+b)}-\frac {(2 b) \int \frac {\sec (c+d x) \left (\frac {1}{4} \left (3 a^2+b^2\right )+a b \sec (c+d x)\right )}{\sqrt {a+b \sec (c+d x)}} \, dx}{\left (a^2-b^2\right )^2} \\ & = -\frac {2 \cot (c+d x) E\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a \sqrt {a+b} d}+\frac {2 \cot (c+d x) \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a \sqrt {a+b} d}+\frac {2 \sqrt {a+b} \cot (c+d x) \operatorname {EllipticPi}\left (\frac {a+b}{a},\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a^2 d}-\frac {\cot (c+d x)}{d (a+b \sec (c+d x))^{3/2}}+\frac {b^2 \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))^{3/2}}+\frac {4 a b^2 \tan (c+d x)}{\left (a^2-b^2\right )^2 d \sqrt {a+b \sec (c+d x)}}-\frac {2 b^2 \tan (c+d x)}{a \left (a^2-b^2\right ) d \sqrt {a+b \sec (c+d x)}}-\frac {((3 a-b) b) \int \frac {\sec (c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx}{2 (a-b) (a+b)^2}-\frac {\left (2 a b^2\right ) \int \frac {\sec (c+d x) (1+\sec (c+d x))}{\sqrt {a+b \sec (c+d x)}} \, dx}{\left (a^2-b^2\right )^2} \\ & = \frac {4 a \cot (c+d x) E\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{(a-b) (a+b)^{3/2} d}-\frac {2 \cot (c+d x) E\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a \sqrt {a+b} d}-\frac {(3 a-b) \cot (c+d x) \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{(a-b) (a+b)^{3/2} d}+\frac {2 \cot (c+d x) \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a \sqrt {a+b} d}+\frac {2 \sqrt {a+b} \cot (c+d x) \operatorname {EllipticPi}\left (\frac {a+b}{a},\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a^2 d}-\frac {\cot (c+d x)}{d (a+b \sec (c+d x))^{3/2}}+\frac {b^2 \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))^{3/2}}+\frac {4 a b^2 \tan (c+d x)}{\left (a^2-b^2\right )^2 d \sqrt {a+b \sec (c+d x)}}-\frac {2 b^2 \tan (c+d x)}{a \left (a^2-b^2\right ) d \sqrt {a+b \sec (c+d x)}} \\ \end{align*}

Mathematica [A] (verified)

Time = 10.81 (sec) , antiderivative size = 469, normalized size of antiderivative = 1.04 \[ \int \frac {\cot ^2(c+d x)}{(a+b \sec (c+d x))^{3/2}} \, dx=\frac {(b+a \cos (c+d x)) \sec ^2(c+d x) \left (-a (b+a \cos (c+d x)) \left (-2 a b+\left (a^2+b^2\right ) \cos (c+d x)\right ) \csc (c+d x)+2 b^4 \sin (c+d x)-2 b \left (a^2+b^2\right ) (b+a \cos (c+d x)) \sin (c+d x)+2 \cos ^2\left (\frac {1}{2} (c+d x)\right ) \left (2 b \left (a^3+a^2 b+a b^2+b^3\right ) \sqrt {\frac {\cos (c+d x)}{1+\cos (c+d x)}} \sqrt {\frac {b+a \cos (c+d x)}{(a+b) (1+\cos (c+d x))}} E\left (\arcsin \left (\tan \left (\frac {1}{2} (c+d x)\right )\right )|\frac {a-b}{a+b}\right )+a \left (2 a^3-a^2 b-6 a b^2-3 b^3\right ) \sqrt {\frac {\cos (c+d x)}{1+\cos (c+d x)}} \sqrt {\frac {b+a \cos (c+d x)}{(a+b) (1+\cos (c+d x))}} \operatorname {EllipticF}\left (\arcsin \left (\tan \left (\frac {1}{2} (c+d x)\right )\right ),\frac {a-b}{a+b}\right )-4 \left (a^2-b^2\right )^2 \sqrt {\frac {\cos (c+d x)}{1+\cos (c+d x)}} \sqrt {\frac {b+a \cos (c+d x)}{(a+b) (1+\cos (c+d x))}} \operatorname {EllipticPi}\left (-1,\arcsin \left (\tan \left (\frac {1}{2} (c+d x)\right )\right ),\frac {a-b}{a+b}\right )+b \left (a^2+b^2\right ) \cos (c+d x) (b+a \cos (c+d x)) \sec ^2\left (\frac {1}{2} (c+d x)\right ) \tan \left (\frac {1}{2} (c+d x)\right )\right )\right )}{a \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))^{3/2}} \]

[In]

Integrate[Cot[c + d*x]^2/(a + b*Sec[c + d*x])^(3/2),x]

[Out]

((b + a*Cos[c + d*x])*Sec[c + d*x]^2*(-(a*(b + a*Cos[c + d*x])*(-2*a*b + (a^2 + b^2)*Cos[c + d*x])*Csc[c + d*x
]) + 2*b^4*Sin[c + d*x] - 2*b*(a^2 + b^2)*(b + a*Cos[c + d*x])*Sin[c + d*x] + 2*Cos[(c + d*x)/2]^2*(2*b*(a^3 +
 a^2*b + a*b^2 + b^3)*Sqrt[Cos[c + d*x]/(1 + Cos[c + d*x])]*Sqrt[(b + a*Cos[c + d*x])/((a + b)*(1 + Cos[c + d*
x]))]*EllipticE[ArcSin[Tan[(c + d*x)/2]], (a - b)/(a + b)] + a*(2*a^3 - a^2*b - 6*a*b^2 - 3*b^3)*Sqrt[Cos[c +
d*x]/(1 + Cos[c + d*x])]*Sqrt[(b + a*Cos[c + d*x])/((a + b)*(1 + Cos[c + d*x]))]*EllipticF[ArcSin[Tan[(c + d*x
)/2]], (a - b)/(a + b)] - 4*(a^2 - b^2)^2*Sqrt[Cos[c + d*x]/(1 + Cos[c + d*x])]*Sqrt[(b + a*Cos[c + d*x])/((a
+ b)*(1 + Cos[c + d*x]))]*EllipticPi[-1, ArcSin[Tan[(c + d*x)/2]], (a - b)/(a + b)] + b*(a^2 + b^2)*Cos[c + d*
x]*(b + a*Cos[c + d*x])*Sec[(c + d*x)/2]^2*Tan[(c + d*x)/2])))/(a*(a^2 - b^2)^2*d*(a + b*Sec[c + d*x])^(3/2))

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(2061\) vs. \(2(416)=832\).

Time = 8.20 (sec) , antiderivative size = 2062, normalized size of antiderivative = 4.59

method result size
default \(\text {Expression too large to display}\) \(2062\)

[In]

int(cot(d*x+c)^2/(a+b*sec(d*x+c))^(3/2),x,method=_RETURNVERBOSE)

[Out]

1/d/a/(a-b)^2/(a+b)^2*(a+b*sec(d*x+c))^(1/2)/(b+a*cos(d*x+c))*(-8*(cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*(1/(a+b)*(
b+a*cos(d*x+c))/(cos(d*x+c)+1))^(1/2)*EllipticPi(cot(d*x+c)-csc(d*x+c),-1,((a-b)/(a+b))^(1/2))*a^2*b^2*cos(d*x
+c)-a^3*b*cot(d*x+c)+2*a^2*b^2*cot(d*x+c)-8*EllipticPi(cot(d*x+c)-csc(d*x+c),-1,((a-b)/(a+b))^(1/2))*(cos(d*x+
c)/(cos(d*x+c)+1))^(1/2)*(1/(a+b)*(b+a*cos(d*x+c))/(cos(d*x+c)+1))^(1/2)*a^2*b^2+4*(cos(d*x+c)/(cos(d*x+c)+1))
^(1/2)*(1/(a+b)*(b+a*cos(d*x+c))/(cos(d*x+c)+1))^(1/2)*EllipticPi(cot(d*x+c)-csc(d*x+c),-1,((a-b)/(a+b))^(1/2)
)*b^4*cos(d*x+c)-2*(cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*(1/(a+b)*(b+a*cos(d*x+c))/(cos(d*x+c)+1))^(1/2)*EllipticE
(cot(d*x+c)-csc(d*x+c),((a-b)/(a+b))^(1/2))*b^4*cos(d*x+c)-2*(cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*(1/(a+b)*(b+a*c
os(d*x+c))/(cos(d*x+c)+1))^(1/2)*EllipticF(cot(d*x+c)-csc(d*x+c),((a-b)/(a+b))^(1/2))*a^4*cos(d*x+c)+4*(cos(d*
x+c)/(cos(d*x+c)+1))^(1/2)*(1/(a+b)*(b+a*cos(d*x+c))/(cos(d*x+c)+1))^(1/2)*EllipticPi(cot(d*x+c)-csc(d*x+c),-1
,((a-b)/(a+b))^(1/2))*a^4*cos(d*x+c)-2*EllipticF(cot(d*x+c)-csc(d*x+c),((a-b)/(a+b))^(1/2))*(cos(d*x+c)/(cos(d
*x+c)+1))^(1/2)*(1/(a+b)*(b+a*cos(d*x+c))/(cos(d*x+c)+1))^(1/2)*a^4+4*EllipticPi(cot(d*x+c)-csc(d*x+c),-1,((a-
b)/(a+b))^(1/2))*(cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*(1/(a+b)*(b+a*cos(d*x+c))/(cos(d*x+c)+1))^(1/2)*a^4+4*Ellip
ticPi(cot(d*x+c)-csc(d*x+c),-1,((a-b)/(a+b))^(1/2))*(cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*(1/(a+b)*(b+a*cos(d*x+c)
)/(cos(d*x+c)+1))^(1/2)*b^4-2*EllipticE(cot(d*x+c)-csc(d*x+c),((a-b)/(a+b))^(1/2))*(cos(d*x+c)/(cos(d*x+c)+1))
^(1/2)*(1/(a+b)*(b+a*cos(d*x+c))/(cos(d*x+c)+1))^(1/2)*b^4-2*(1/(a+b)*(b+a*cos(d*x+c))/(cos(d*x+c)+1))^(1/2)*E
llipticE(cot(d*x+c)-csc(d*x+c),((a-b)/(a+b))^(1/2))*(cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*a^3*b-2*(1/(a+b)*(b+a*co
s(d*x+c))/(cos(d*x+c)+1))^(1/2)*EllipticE(cot(d*x+c)-csc(d*x+c),((a-b)/(a+b))^(1/2))*(cos(d*x+c)/(cos(d*x+c)+1
))^(1/2)*a^2*b^2-2*(1/(a+b)*(b+a*cos(d*x+c))/(cos(d*x+c)+1))^(1/2)*EllipticE(cot(d*x+c)-csc(d*x+c),((a-b)/(a+b
))^(1/2))*(cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*a*b^3+(1/(a+b)*(b+a*cos(d*x+c))/(cos(d*x+c)+1))^(1/2)*EllipticF(co
t(d*x+c)-csc(d*x+c),((a-b)/(a+b))^(1/2))*(cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*a^3*b+6*(1/(a+b)*(b+a*cos(d*x+c))/(
cos(d*x+c)+1))^(1/2)*EllipticF(cot(d*x+c)-csc(d*x+c),((a-b)/(a+b))^(1/2))*(cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*a^
2*b^2+3*(1/(a+b)*(b+a*cos(d*x+c))/(cos(d*x+c)+1))^(1/2)*EllipticF(cot(d*x+c)-csc(d*x+c),((a-b)/(a+b))^(1/2))*(
cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*a*b^3-3*a*b^3*cot(d*x+c)+2*a^3*b*cos(d*x+c)*cot(d*x+c)-a^2*b^2*cos(d*x+c)*cot
(d*x+c)+2*a*b^3*cos(d*x+c)*cot(d*x+c)+EllipticF(cot(d*x+c)-csc(d*x+c),((a-b)/(a+b))^(1/2))*(1/(a+b)*(b+a*cos(d
*x+c))/(cos(d*x+c)+1))^(1/2)*(cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*a^3*b*cos(d*x+c)+6*EllipticF(cot(d*x+c)-csc(d*x
+c),((a-b)/(a+b))^(1/2))*(1/(a+b)*(b+a*cos(d*x+c))/(cos(d*x+c)+1))^(1/2)*(cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*a^2
*b^2*cos(d*x+c)+3*EllipticF(cot(d*x+c)-csc(d*x+c),((a-b)/(a+b))^(1/2))*(1/(a+b)*(b+a*cos(d*x+c))/(cos(d*x+c)+1
))^(1/2)*(cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*a*b^3*cos(d*x+c)-2*(1/(a+b)*(b+a*cos(d*x+c))/(cos(d*x+c)+1))^(1/2)*
(cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*EllipticE(cot(d*x+c)-csc(d*x+c),((a-b)/(a+b))^(1/2))*a^3*b*cos(d*x+c)-2*(1/(
a+b)*(b+a*cos(d*x+c))/(cos(d*x+c)+1))^(1/2)*(cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*EllipticE(cot(d*x+c)-csc(d*x+c),
((a-b)/(a+b))^(1/2))*a^2*b^2*cos(d*x+c)-2*(1/(a+b)*(b+a*cos(d*x+c))/(cos(d*x+c)+1))^(1/2)*(cos(d*x+c)/(cos(d*x
+c)+1))^(1/2)*EllipticE(cot(d*x+c)-csc(d*x+c),((a-b)/(a+b))^(1/2))*a*b^3*cos(d*x+c)-a^4*cos(d*x+c)*cot(d*x+c)-
2*b^4*cos(d*x+c)*cot(d*x+c)+2*b^4*cot(d*x+c))

Fricas [F(-1)]

Timed out. \[ \int \frac {\cot ^2(c+d x)}{(a+b \sec (c+d x))^{3/2}} \, dx=\text {Timed out} \]

[In]

integrate(cot(d*x+c)^2/(a+b*sec(d*x+c))^(3/2),x, algorithm="fricas")

[Out]

Timed out

Sympy [F]

\[ \int \frac {\cot ^2(c+d x)}{(a+b \sec (c+d x))^{3/2}} \, dx=\int \frac {\cot ^{2}{\left (c + d x \right )}}{\left (a + b \sec {\left (c + d x \right )}\right )^{\frac {3}{2}}}\, dx \]

[In]

integrate(cot(d*x+c)**2/(a+b*sec(d*x+c))**(3/2),x)

[Out]

Integral(cot(c + d*x)**2/(a + b*sec(c + d*x))**(3/2), x)

Maxima [F]

\[ \int \frac {\cot ^2(c+d x)}{(a+b \sec (c+d x))^{3/2}} \, dx=\int { \frac {\cot \left (d x + c\right )^{2}}{{\left (b \sec \left (d x + c\right ) + a\right )}^{\frac {3}{2}}} \,d x } \]

[In]

integrate(cot(d*x+c)^2/(a+b*sec(d*x+c))^(3/2),x, algorithm="maxima")

[Out]

integrate(cot(d*x + c)^2/(b*sec(d*x + c) + a)^(3/2), x)

Giac [F]

\[ \int \frac {\cot ^2(c+d x)}{(a+b \sec (c+d x))^{3/2}} \, dx=\int { \frac {\cot \left (d x + c\right )^{2}}{{\left (b \sec \left (d x + c\right ) + a\right )}^{\frac {3}{2}}} \,d x } \]

[In]

integrate(cot(d*x+c)^2/(a+b*sec(d*x+c))^(3/2),x, algorithm="giac")

[Out]

integrate(cot(d*x + c)^2/(b*sec(d*x + c) + a)^(3/2), x)

Mupad [F(-1)]

Timed out. \[ \int \frac {\cot ^2(c+d x)}{(a+b \sec (c+d x))^{3/2}} \, dx=\int \frac {{\mathrm {cot}\left (c+d\,x\right )}^2}{{\left (a+\frac {b}{\cos \left (c+d\,x\right )}\right )}^{3/2}} \,d x \]

[In]

int(cot(c + d*x)^2/(a + b/cos(c + d*x))^(3/2),x)

[Out]

int(cot(c + d*x)^2/(a + b/cos(c + d*x))^(3/2), x)